#!/usr/bin/env python
import argparse
import sys
import os
# sys.path.insert(0,'./scripts/')
# from scripts import FastCGI, MySQL, PostgreSQL, DumpMemcached, PHPMemcached, PyMemcached, RbMemcached, Redis, SMTP, Zabbix
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'scripts'))
from scripts.FastCGI import FastCGI
from scripts.MySQL import MySQL
from scripts.PostgreSQL import PostgreSQL
from scripts.DumpMemcached import DumpMemcached
from scripts.PHPMemcached import PHPMemcached
from scripts.PyMemcached import PyMemcached
from scripts.RbMemcached import RbMemcached
from scripts.Redis import Redis
from scripts.SMTP import SMTP
from scripts.Zabbix import Zabbix

parser = argparse.ArgumentParser()
parser.add_argument("--exploit",
                    help="mysql, postgresql, fastcgi, redis, smtp, zabbix, "
                         "dmpmemcache, phpmemcache, rbmemcache, pymemcache ")
args = parser.parse_args()

class colors:
    reset='\033[0m'
    red='\033[31m'
    green='\033[32m'
    orange='\033[33m'
    blue='\033[34m'

logo = """

  ________              .__
 /  _____/  ____ ______ |  |__   ___________ __ __  ______
/   \  ___ /  _ \\\\____ \|  |  \_/ __ \_  __ \  |  \/  ___/
\    \_\  (  <_> )  |_> >   Y  \  ___/|  | \/  |  /\___ \\
 \______  /\____/|   __/|___|  /\___  >__|  |____//____  >
        \/       |__|        \/     \/                 \/
"""

print(colors.green + logo + "\n\t\t" + colors.blue + "author: " + colors.orange + "$_SpyD3r_$" + "\n\t\t" + colors.blue + "modfied: " + colors.orange + "@_mingy_@" + colors.reset)

if(not args.exploit):
    print(parser.print_help())
    exit()

if(args.exploit=="mysql"):
    MySQL()
elif(args.exploit=="postgresql"):
    PostgreSQL()
elif(args.exploit=="fastcgi"):
    FastCGI()
elif(args.exploit=="redis"):
    Redis()
elif(args.exploit=="smtp"):
    SMTP()
elif(args.exploit=="zabbix"):
    Zabbix()
elif(args.exploit=="dmpmemcache"):
    DumpMemcached()
elif(args.exploit=="phpmemcache"):
    PHPMemcached()
elif(args.exploit=="rbmemcache"):
    RbMemcached()
elif(args.exploit=="pymemcache"):
    PyMemcached()
else:
    print(parser.print_help())
